<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>求和</title>
</head>

<body>
    <script>
        const array = ["10", "20", "30", "40"];
        let a = "10";

        let b = "20";

        let c = "30";

        let d = "40";
        console.log((+a) + (+b) + (+c) + (+d));
        console.log((+array[0]) + (+array[1]) + (+array[2]) + (+array[3]))
        console.log(parseInt("10") + parseInt("20") + parseInt("30") + parseInt("40"))
    </script>
</body>

</html>